﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LGE;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace YouOnlyGetOne
{
    class SplashScreen : GameScreen
    {
        Texture2D bgSprite;
        double timer = 2000;

        public SplashScreen()
            : base()
        {
        }

        public override void LoadContent()
        {
            bgSprite = Engine.Load<Texture2D>("Images\\splash");
        }

        public override void Update(GameTime gameTime)
        {
            if (timer == 2000) Audio.PlayCue("splashscreen");
            timer -= gameTime.ElapsedGameTime.TotalMilliseconds;
            if (timer < 0 || Input.Pressed(KeyMap.Enter))
                GameScreenManager.ChangeScreen(new StartScreen());
        }

        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(bgSprite, Vector2.Zero, Color.White);
        }
    }
}
